﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlTypes;
using System.Data.SqlClient;
namespace Person
{
    class Program
    {
        static void Main(string[] args)
        {
            
            string connectionString = "server=.;database=Supper；uid=sa;pwd=123456";
            SqlConnection sqlConnection = new SqlConnection(connectionString );//函数的调用
            sqlConnection.Open();//打开数据库

           
            var sqlcommandString = "slect * form Users ";//查询列表
            SqlCommand sqlCommand = new SqlCommand(sqlcommandString, sqlConnection);

            var sda = sqlCommand.ExecuteReader ();

            while (sda .Read ())
            {
                Console.WriteLine("{0}\t{1}\t{2}\t", sda["Id"], sda["name"], sda["stingName"]);
            }
            sqlConnection.Close();//关闭数据库
        }
    }
}
